#!/bin/bash
scriptPath=$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd);
echo "script path: "$scriptPath
mainPath=$(dirname $scriptPath)
echo "main.go path："$mainPath
execName="AiSpeaker"
releasePath="$mainPath/out/linux"
confPath="$releasePath/$execName/conf"

`mkdir -p $confPath`
`cp $mainPath/conf/* $confPath`

echo "#!/bin/sh\nchmod 754 ./${execName}\nnohup ./${execName} > /dev/null 2>&1 & \necho \"AI云广播启动完成\"" > $releasePath/$execName/startup.sh
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $releasePath/$execName/$execName $mainPath/cmd/main.go

